package cn.zj.admin.modules.issues.service;

import com.zj.util.utils.value.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zj.admin.modules.issues.domain.Issues;
import cn.zj.admin.modules.issues.repository.IssuesRepository;

import java.util.Date;

/**
 * @author xi.yang
 * @create 2020-06-22 17:10
 **/
@Service
public class IssuesService {
    @Autowired
    private IssuesRepository projectRepository;

    public Issues save(Issues project) {
        if (StringUtil.isBlank(project.getId())) {
            project.setCreateTime(new Date());
        }
        return projectRepository.save(project);
    }
}
